feat: Add Twitter/X post support (Frontend)#5290
Draft
Conversation
Add Tweet to PostType enum and extend Post interface with tweet-specific fields including TweetMedia and TweetData types. New fields: - tweetId, tweetAuthorUsername/Name/Avatar/Verified - tweetContent, tweetContentHtml, tweetMedia - tweetCreatedAt, isThread, threadTweets Also adds isTweetPost helper function. ENG-308
Add tweet components for displaying Twitter posts in detail view: - TweetAuthorHeader: Author info with avatar, name, handle, verified badge - TweetContent: Tweet text with parsed links, mentions, and hashtags - TweetPostContent: Main wrapper with media preview and "View on X" link Register Tweet type in SquadPostContent ContentMap for proper routing. ENG-309
ENG-314: Add Tweet post type support to post content routing. - Update TweetPostContent to conform to PostContentProps interface - Create TweetPostModal for feed modal views - Add PostType.Tweet to PostModalMap in Feed.tsx - Add PostType.Tweet to CONTENT_MAP in post page
ENG-317: Create UI components for tweets being processed. - Add TweetCardSkeleton for feed cards while tweet is loading - Add TweetContentLoading for post detail view loading state - Add TweetProcessingError for failed tweet processing - Twitter branding visible in all states - Optional author info display from preview data
ENG-320: Create comprehensive Storybook documentation for tweet components. Stories created: - TweetGrid (cards): Default, with images, video, long text, thread, unverified - TweetList (cards): Same variants as grid in list layout - TweetCardSkeleton: Loading states with/without author info - TweetMediaGallery: 1-4 images, video, GIF, empty states - TweetThread: Short/long threads, expanded, custom preview count - TweetAuthorHeader: Verified/unverified, long names, no avatar - TweetContentLoading: Loading states with author/URL info - TweetProcessingError: Error states with various action configs Also adds mock/tweet.ts with comprehensive mock data for all stories.
ENG-315: Handle Twitter error states in frontend. - Add TweetStatus type for tweet availability states - Add TweetMedia fields for width/height/duration - Add tweetStatus and tweetErrorReason to Post interface - Add tweet engagement count fields (like, retweet, reply) - Add threadSize field for thread metadata - Add helper functions: isTweetAvailable, isTweetProcessing, isTweetError - Add getTweetErrorMessage for user-friendly error messages
Add comprehensive tests for: - Tweet helper functions (isTweetPost, isTweetAvailable, isTweetProcessing, isTweetError, getTweetErrorMessage) - TweetGrid component (author info, content, verified badge, X link, actions) - TweetList component (content, media preview, X link, actions) - Test fixtures for various tweet post states (normal, media, thread, processing, deleted, private, failed)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Preview domain
https://twitter-support2.preview.app.daily.dev